package org.alex.samples.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "exam_subject")
public class ExamSubject implements Serializable {

	private static final long serialVersionUID = 8697062635643717405L;

	@Id
	@GeneratedValue
	@Column(name = "sub_id", nullable = false)
	private Integer id;

	@Column(name = "name", nullable = false)
	private String name;

	@Column(name = "description", nullable = false)
	private String description;

	@Column(name = "test_count", nullable = false)
	private String testCount;

	@Column(name = "total_time", nullable = false)
	private Integer totalTime;

	@Column(name = "total_score", nullable = false)
	private double totalScore;

	@Column(name = "status", nullable = false)
	private Integer status;

	@ManyToMany(mappedBy = "examSubjects", fetch= FetchType.EAGER)
	private Set<ExamUser> examUsers;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTestCount() {
		return testCount;
	}

	public void setTestCount(String testCount) {
		this.testCount = testCount;
	}

	public Integer getTotalTime() {
		return totalTime;
	}

	public void setTotalTime(Integer totalTime) {
		this.totalTime = totalTime;
	}

	public double getTotalScore() {
		return totalScore;
	}

	public void setTotalScore(double totalScore) {
		this.totalScore = totalScore;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Set<ExamUser> getExamUsers() {
		return examUsers;
	}

	public void setExamUsers(Set<ExamUser> examUsers) {
		this.examUsers = examUsers;
	}

}